package com.haizheng.sockte;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static java.util.regex.Pattern.compile;

/**
 * @program: Demo
 * @description: 用完就删
 * @author: Hz~
 * @create: 2019-02-18 15:08
 **/
public class Demo {

    public static void main(String[] args) {
        System.out.println(getCharacterPosition("GET /Demo/demo1.html HTTP/1.1\nHost: localhost:8080"));

    }


    public static String getCharacterPosition(String string) {
        int start = StringUtils.ordinalIndexOf(string, " ", 1);
        int ent = StringUtils.ordinalIndexOf(string, " ", 2);
        return string.substring(start,ent);
    }
}
